package com.qyhl.cloud.webtv.module_integral.message;


import com.qyhl.webtv.commonlib.entity.intergral.MessageBean;

import java.util.List;

public class MessagePresenter implements MessageContract.MessagePresenter {
    private MessageActivity mView;
    private MessageModel mModel;

    public MessagePresenter(MessageActivity mView) {
        this.mView = mView;
        this.mModel = new MessageModel(this);
    }

    @Override
    public void getMessage(String username, String lastDate) {
        mModel.getMessage(username, lastDate);
    }

    @Override
    public void getMessageSuccess(List<MessageBean> beanList) {
        mView.getMessageSuccess(beanList);
    }

    @Override
    public void getMessageError(int code, String msg) {
        switch (code) {
            case 0:
                mView.netWorkError(msg);
                break;
            default:
                mView.getMessageError(msg);
                break;
        }
    }

    @Override
    public void domark(String username) {
        mModel.domark(username);
    }
}
